<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Gregwar\Captcha\CaptchaBuilder;
use Session;

class CodeController extends Controller
{
    //验证码
    public function code($random = 1000)
    {	
    	ob_end_clean();
		$builder = new CaptchaBuilder;
		$builder->build(86, 34);
		Session::put('code',$builder->getPhrase());
		header('Content-type: image/jpeg');
		$builder->output();
    } 
}
